package cc.cc4414.cc02.system.converter;

import java.util.List;
import java.util.stream.Collectors;

import org.springframework.beans.BeanUtils;

import cc.cc4414.cc02.system.entity.User;
import cc.cc4414.cc02.system.form.UserForm;

/**
 * @author cc 2018年6月29日
 */
public class UserForm2UserConverter {
	public static User convert(UserForm userForm) {
		User user = new User();
		BeanUtils.copyProperties(userForm, user);
		return user;
	}

	public static List<User> convert(List<UserForm> userForms) {
		return userForms.stream().map(e -> convert(e)).collect(Collectors.toList());
	}
}
